package com.ruoyi.system.domain;

import lombok.Data;

import java.util.List;

/**
 * 用户对象 sys_user
 *
 * @author ruoyi
 */
@Data
public class SysUser extends SysUserPo {
    private static final long serialVersionUID = 1L;

    private SysDept dept;

    /**
     * 角色对象
     */
    private List<SysRole> roleList;

    private List<SysPost> postList;

    private List<SysDept> deptList;

    /**
     * 部门组（数据权限）
     */
    private List<Long> deptIds;

    /**
     * 角色组
     */
    private List<Long> roleIds;

    /**
     * 岗位组
     */
    private List<Long> postIds;

    public static boolean isAdmin(Long userId) {
        return userId != null && 1L == userId;
    }

    public boolean isAdmin() {
        return isAdmin(getUserId());
    }

}
